


function checkregcheckdata(){
	
	var checkusernameflag = checkusername();
	if(!checkusernameflag){
		return false;
	}
	
	var checkpasswordflag = checkpassword();
	if(!checkpasswordflag){
		return false;
	}
	
	
	var checkpassword2flag = checkpassword2();
	if(!checkpassword2flag){
		return false;
	}
	
	
	var checkpwd1andpwd2flag = checkpwd1andpwd2();
	if(!checkpwd1andpwd2flag){
		return false;
	}
	
	
	var checkphoneflag = checkphone();
	if(!checkphoneflag){
		return false;
	}
	
	
	var checkaddrflag = checkaddr();
	if(!checkaddrflag){
		return false;
	}
	
	return true;
}

//check用户名数据合法性
function checkusername(){
	
	var length = regform.username.value.trim().length;
	if(length==0){
		alert("用户名长度为15位");
		regform.username.focus();
		return false;
	}
	
	return true;
}

//check密码数据合法性
function checkpassword(){
	
	var length = regform.password.value.trim().length;
	if(length==0){
		alert("密码长度为15位");
		regform.password.focus();
		return false;
	}
	return true;
}


//check密码2数据合法性
function checkpassword2(){
	
	var length = regform.password2.value.trim().length;
	if(length==0){
		alert("确认密码长度为15位");
		regform.password2.focus();
		return false;
	}
	return true;
}


//check密码1与密码2是否一致,数据合法性
function checkpwd1andpwd2(){
	
	var pwd1 = regform.password.value;
	var pwd2 = regform.password2.value;
	if(pwd1!=pwd2){
		alert("两次密码不一致");
		regform.password2.focus();
		return false;
	}
	return true;
}



//check用户名数据合法性
function checkphone(){
	
	var length = regform.phone.value.trim().length;
	if(length==0){
		alert("电话号码长度为15位");
		regform.phone.focus();
		return false;
	}
	return true;
}


//check用户名数据合法性
function checkaddr(){
	
	var length = regform.addr.value.trim().length;
	if(length==0){
		alert("地址长度为15位");
		regform.addr.focus();
		return false;
	}
	return true;
}




//清空注册form
function clearregform(){
	
	
	regform.username.value = "";
	
	regform.password.value = "";
	
	regform.password2.value = "";
	
	regform.phone.value = "";
	
	regform.addr.value = "";
	
	regform.username.focus();
}



